home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_12
/
9n12102a
< prev
next >
Wrap
Text File
|
1991-10-28
|
1KB
|
26 lines
// Listing 1 - Header file for binaryfile class
// This only contains the class's elements
//
// Copyright Marietta Systems, Inc. 1991
// Author: Roger J Stringer
// All rights reserved
enum FILEMODE {Readonly, Update, AnyWrite, Append, Recreate};
enum READMODE {FirstRecord, NextRecord, PreviousRecord, LastRecord};
enum SHAREMODE {NoneShared, ReadShared, WriteShared};
class binaryfile {
private:
char name[81]; // name of file (size is DOS specific)
enum FILEMODE mode; // access mode of the file
enum SHAREMODE share; // whether shared access is allowed
unsigned length; // record length
int handle; // file handle (-1 if not open)
long header; // size of header at start of file
long count; // number of records in the file
long recnbr; // current record number (starting at 1)
long locked; // if >0, currently locked record
public:
char *record; // pointer to record area
};